<!--
 * @Author: 吴竹叶 2107206923@qq.com
 * @Date: 2023-09-27 15:22:32
 * @LastEditors: 吴竹叶 2107206923@qq.com
 * @LastEditTime: 2023-09-28 17:18:20
 * @FilePath: \BZ_JT_AnQuanHuanBaoGuanLiApp\src\views\staging\commom\statistics\index.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <div class="common-details">
    <!--     px-1 pb-1-->
    <customDetailsTopbar title="综合统计" flag @back="back" />
    <div class=" px-1 pb-1 d-scroll listInner">
      <div class="common_list">
        <safety-statistic v-if="current === '安全生产'" />
        <environment-statistic v-if="current === '环保管理'" />
        <fire-statistic v-if="current === '消防管理'" />
        <energy-statistic v-if="current === '能源管理'" />
        <carbon-statistic v-if="current === '碳排放管理'" />
      </div>
    </div>

  </div>
</template>

<script>
import safetyStatistic from './components/safetyStatistic.vue'
import environmentStatistic from './components/environmentStatistic.vue'
import fireStatistic from './components/fireStatistic.vue'
import energyStatistic from './components/energyStatistic.vue'
import carbonStatistic from './components/carbonStatistic.vue'
import CustomDetailsTopbar from '@/components/globals/custom-details-topbar.vue'

export default {
  components: {
    CustomDetailsTopbar,
    safetyStatistic,
    environmentStatistic,
    fireStatistic,
    energyStatistic,
    carbonStatistic
  },
  data() {
    return {
      current: ''
    }
  },
  mounted() {
    const { current } = this.$route.query
    if (current) {
      this.current = current
    }
  },
  methods: {
    // 返回工作台
    back() {
      this.$router.push({
        path: '/staging/monitor',
        query: { current: this.current }
      })
    }
  }
}
</script>

<style lang="scss" scoped></style>
